﻿import pymongo
import json
myclient = pymongo.MongoClient("mongodb://localhost:27017")
mydb = myclient['runoobdb']
byrgPhone = mydb['byrgPhone']
# a = byrgPhone.delete_many({})
# print(a.deleted_count)
# dblist = myclient.list_database_names()
objdate = []
for x in byrgPhone.find():
  objdate.append(x)
  print(x)
fo = open("byrgRemark.json","w",encoding='utf8')
fo.write(json.dumps(objdate, ensure_ascii=False))
fo.close()
